package game.input;

import org.lwjgl.input.Keyboard;

public class KeyManager {

   public static boolean UP;
   public static boolean DOWN;
   public static boolean LEFT;
   public static boolean RIGHT;
   
   public static void update(){
      resetKeys();
      if(Keyboard.isKeyDown(Keyboard.KEY_UP) || Keyboard.isKeyDown(Keyboard.KEY_W)){
         UP = true;
      }
      if(Keyboard.isKeyDown(Keyboard.KEY_DOWN) || Keyboard.isKeyDown(Keyboard.KEY_S)){
         DOWN = true;
      }
      if(Keyboard.isKeyDown(Keyboard.KEY_LEFT) || Keyboard.isKeyDown(Keyboard.KEY_A)){
         LEFT = true;
      }
      if(Keyboard.isKeyDown(Keyboard.KEY_RIGHT) || Keyboard.isKeyDown(Keyboard.KEY_D)){
         RIGHT = true;
      }
   }
   
   private static void resetKeys(){
      UP = false;
      DOWN = false;
      LEFT = false;
      RIGHT = false;
   }
}
